/**
 *
 */
package com.magist.manage.enums;

import com.magist.core.enums.BaseEnum;
import com.magist.core.util.TxtUtil;

/**
 * 邮件发送类型
 */
public enum EmailSendTypeEnum implements BaseEnum {

    CONTACT("CONTACT", "合同到期"), CONTENT("CONTENT", "版权到期"), INPUT("INPUT",
            "授权到期"), BUSINESS("BUSINESS", "版权上线"), BUSINESS1("BUSINESS", "供应商跟进");

    private String code;

    private String desc;

    private EmailSendTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static EmailSendTypeEnum getByCode(String code) {
        if (TxtUtil.isEmpty(code))
            return null;
        EmailSendTypeEnum[] allEnums = EmailSendTypeEnum.values();
        for (EmailSendTypeEnum thisEnum : allEnums) {
            if (thisEnum.code.equals(code)) {
                return thisEnum;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
